#pragma once
#include "core_headers.hpp"

#define INFO 0
#define DELETE 1
#define ERROR 2
#define LOG_LEVEL ERROR 
		// 2    >=    2   break
		// 1    >=   2    break
		// 0    >=   2    break
#define LOG(level,format,...) do{\
		if(level <= LOG_LEVEL) break;\
		time_t t = time(NULL);\
		struct tm *timeinfo = localtime(&t);\
		char buffer[32] = {0};\
		strftime(buffer,31,"%Y-%m-%d %H:%M:%S",timeinfo);\
		fprintf(stdout,"[%p %s %s:%d] " format "\n", (void*)pthread_self() ,buffer,__FILE__,__LINE__,##__VA_ARGS__);\
}while(0)

#define INF_LOG(format,...) LOG(INFO,format,##__VA_ARGS__)
#define DEL_LOG(format,...) LOG(DELETE,format,##__VA_ARGS__)
#define ERR_LOG(format,...) LOG(ERROR,format,##__VA_ARGS__)